'use strict';

const uniID = require('uni-id-common')

exports.main = async (event, context) => {
	const {
		uniIdToken
	} = event
	const uniIDIns = uniID.createInstance({
		context: context,
	})
	const {
		uid,
		role,
		permission
	} = await uniIDIns.checkToken(uniIdToken)

	//返回数据给客户端
	return role
};